cmake_minimum_required(VERSION 3.10)
project(embed_demo LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)

# 修改为你onnxruntime解压路径
set(ONNXRUNTIME_DIR "/workspace/onnxruntime-linux-x64-gpu-1.22.0")

include_directories(${ONNXRUNTIME_DIR}/include)
link_directories(${ONNXRUNTIME_DIR}/lib)

add_executable(embed_demo src/main.cpp)

# 链接 onnxruntime 库
target_link_libraries(embed_demo PRIVATE
    onnxruntime
    onnxruntime_providers_shared
    onnxruntime_providers_cuda
)

# 设置 rpath
set_target_properties(embed_demo PROPERTIES
  BUILD_RPATH "${ONNXRUNTIME_DIR}/lib"
  INSTALL_RPATH "${ONNXRUNTIME_DIR}/lib"
)
